clear all; close all; clc;

R=220;
C=33e-12;
L=100e-6;

tau=R*C;
fprintf('tau = %f ns\n', tau*1e9);

T=tau/10000;
t=0:T:(5*tau);
lt=length(t);

Uc=nan(1,lt);
dUc=nan(1,lt);
Ur=nan(1,lt);

E=10*ones(1,lt);

Uc(1)=0; 
for k=2:lt
    Uc(k)=(E(k)*T+R*C*Uc(k-1))/(T+R*C);
end
figure(1);
plot(t*1e9,[Uc+0.1; E]);
xlabel('t,ns');
ylabel('U_c,E,Volt');
legend('U(t)','E(t)');
grid on;



    